import Vue from 'vue'
import VueRouter from 'vue-router'
import Layout from '@/views/layout.vue'
import HomePage from '@/views/home-page.vue'
import FindHome from '@/views/find-home.vue'
import MyInfo from '@/views/my-info.vue'
import MyUser from '@/views/my-user.vue'
import City from '@/views/city-page.vue'

// import { getToken } from '@/utils/storage.js'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    redirect: '/homepage',
    component: Layout,
    children: [
      { path: '/homepage', component: HomePage },
      { path: '/findhome', component: FindHome },
      { path: '/myuser', component: MyUser },
      { path: '/myinfo', component: MyInfo }
    ]
  },
  { path: '/city', component: City }
]

const router = new VueRouter({
  routes
})

export default router
